import Vue from 'vue'
import Router from 'vue-router'
import Home from '@view/Home'
import Login from '@view/Login'
import Mine from '@view/Mine'
import ArticleList from '@view/ArticleList'
import Search from '@view/Search'
import EditArticle from '@view/EditArticle'
import ProductList from '@view/ProductList'
import ShoppingCart from '@view/ShoppingCart'
import UploadImg from '@/components/commonvue/uploadImg'
//产品
import Product from '@view/product/Product'
import NewProduct from '@view/product/NewProduct'
import PromotionProduct from '@view/product/PromotionProduct'
import StarProduct from '@view/product/StarProduct'


Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/', // 首页
      name: 'Home',
      component: Home
    }, {
      path: '/login', // 登录页
      name: 'Login',
      component: Login
    }, {
      path: '/mine', // 我的
      name: 'Mine',
      component: Mine
    }, {
      path: '/articleList', // 文章列表
      name: 'ArticleList',
      component: ArticleList
    }, {
      path: '/search', // 搜索列表
      name: 'Search',
      component: Search
    }, {
      path: '/editArticle', // 编辑文章
      name: 'EditArticle',
      component: EditArticle
    }, {
      path: '/productList', // productList
      name: 'productList',
      component: ProductList
    }, {
      path: '/shoppingCart', // shoppingCart
      name: 'shoppingCart',
      component: ShoppingCart
    }, {
      path: '/uploadImg', // UploadImg
      name: 'uploadImg',
      component: UploadImg
    }, {
      path: '/Product', // 产品
      name: 'Product',
      component: Product,
      children:[
        { path: '/Product/NewProduct', component: NewProduct},
        { path: '/Product/PromotionProduct', component: PromotionProduct},
        { path: '/Product/StarProduct', component: StarProduct},
    ]
    }
  ]
})
